<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resource/bootstrap4/css/bootstrap.css">
    <script src="${pageContext.request.contextPath}/resource/js/jquery-3.2.1.js"></script>
    <script src="${pageContext.request.contextPath}/resource/bootstrap-treeview/js/bootstrap-treeview.js"></script>
    <script src="${pageContext.request.contextPath}/resource/bootstrap4/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/resource/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<form>
    <input type="hidden" name="id" value="${desire.id}">
    名称：<input name="name" value="${desire.name}">
</form>
<button type="button" onclick="sub()">提交</button>
<script>
    function sub() {
        $.post("${pageContext.request.contextPath}/desire/update",$("form").serialize(),function (result) {
            if (result > 0){
                alert("修改成功!");
                location='${pageContext.request.contextPath}/desire/list'
            }
        })
    }
</script>
</body>
</html>
